package cn.tedu.d17_thread;

public class Test3_SaleTickets1 {
    public static void main(String[] args) {
        TickerThread t=new TickerThread();
        TickerThread t1=new TickerThread();
        TickerThread t2=new TickerThread();
        TickerThread t3=new TickerThread();
        t.start();t1.start();t2.start();t3.start();

    }
}

class TickerThread extends Thread{
    static int tickets=100;

    public void run(){
        while (true){
            System.out.println(getName()+"="+tickets--);
            if(tickets<=0) break;
        }
    }

}
